package com.edu.dgut.dao;

import com.edu.dgut.entity.wUserEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import javax.transaction.Transactional;
import java.util.List;

public interface wUserRepository extends JpaRepository<wUserEntity,String> {

    //通过open_id查询微信用户信息
    List<wUserEntity> findByOpenId(String open_id);

    //通过微信昵称查询用户信息
    List<wUserEntity> findByNameLike(String name);

    //插入或修改微信用户信息
    wUserEntity save(wUserEntity wuser);

    //通过open_id删除微信用户信息
    @Transactional
    int deleteByOpenId(String open_id);
}
